function fn2() {
  function getContentByUrl(url) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(`${url}的内容`);
      }, 1000);
    });
  }
  const urls = [
    "https://www.taobao.com",
    "https://www.baidu.com",
    "https://web.taobao.com",
  ];

  function fetchData(urls = []) {
    urls = urls
      .filter((url) => url.endsWith("taobao.com"))
      .map((url) => getContentByUrl(url));
    console.log(urls);

    return Promise.all(urls);
  }

  fetchData(urls).then((ret) => console.log(ret));
}
